package com.b511.swpu.cementbackend.repository;

import com.b511.swpu.cementbackend.entity.MetaUnitCategoryValue;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface MetaUnitCategoryValueRepository extends JpaRepository<MetaUnitCategoryValue, Long> {

    @Query(value = "SELECT ID,UNIT_NAME FROM META_UNIT_CATEGORY_VALUE WHERE UNIT_CATEGORY_ID=:unitCategoryId AND  UNIT_NAME=:unitName", nativeQuery = true)
    MetaUnitCategoryValue findByCategoryIdAndInternationalUnits(@Param("unitCategoryId") Long unitCategoryId, @Param("unitName") String internationalUnits);
}
